package com.alan.camunda.boot.delegate;

import lombok.extern.slf4j.Slf4j;
import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;

/**
 * 主动抛出一个 BPMN 异常
 */
@Slf4j
@Component("myEngineErrorDelegate")
public class MyEngineErrorDelegate implements JavaDelegate {


    @Override
    public void execute(DelegateExecution execution) throws Exception {
        log.info("Throw an engine error in delegate class.");
        throw new ProcessEngineException("发生了一个引擎错误");
    }



}
